package com.baobao.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllBanjis", query = "select myBanji from Banji myBanji"),
		@NamedQuery(name = "findBanjiById", query = "select myBanji from Banji myBanji where myBanji.id = ?1"),
		@NamedQuery(name = "findBanjiByIdContaining", query = "select myBanji from Banji myBanji where myBanji.id like ?1"),
		@NamedQuery(name = "findBanjiByMasterName", query = "select myBanji from Banji myBanji where myBanji.masterName = ?1"),
		@NamedQuery(name = "findBanjiByMasterNameContaining", query = "select myBanji from Banji myBanji where myBanji.masterName like ?1"),
		@NamedQuery(name = "findBanjiByMasterPhone", query = "select myBanji from Banji myBanji where myBanji.masterPhone = ?1"),
		@NamedQuery(name = "findBanjiByMasterPhoneContaining", query = "select myBanji from Banji myBanji where myBanji.masterPhone like ?1"),
		@NamedQuery(name = "findBanjiByName", query = "select myBanji from Banji myBanji where myBanji.name = ?1"),
		@NamedQuery(name = "findBanjiByNameContaining", query = "select myBanji from Banji myBanji where myBanji.name like ?1"),
		@NamedQuery(name = "findBanjiByPrimaryKey", query = "select myBanji from Banji myBanji where myBanji.id = ?1"),
		@NamedQuery(name = "findBanjiBySchoolId", query = "select myBanji from Banji myBanji where myBanji.schoolId = ?1"),
		@NamedQuery(name = "findBanjiBySchoolIdContaining", query = "select myBanji from Banji myBanji where myBanji.schoolId like ?1") })
@Table(catalog = "baobaodb", name = "banji")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "bb/com/baobao/domain", name = "Banji")
public class Banji implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "id", length = 20, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	String id;
	/**
	 */

	@Column(name = "school_id", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String schoolId;
	/**
	 */

	@Column(name = "name", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String name;
	/**
	 */

	@Column(name = "master_name", length = 20)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String masterName;
	/**
	 */

	@Column(name = "master_phone", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String masterPhone;

	/**
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 */
	public String getId() {
		return this.id;
	}

	/**
	 */
	public void setSchoolId(String schoolId) {
		this.schoolId = schoolId;
	}

	/**
	 */
	public String getSchoolId() {
		return this.schoolId;
	}

	/**
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 */
	public String getName() {
		return this.name;
	}

	/**
	 */
	public void setMasterName(String masterName) {
		this.masterName = masterName;
	}

	/**
	 */
	public String getMasterName() {
		return this.masterName;
	}

	/**
	 */
	public void setMasterPhone(String masterPhone) {
		this.masterPhone = masterPhone;
	}

	/**
	 */
	public String getMasterPhone() {
		return this.masterPhone;
	}

	/**
	 */
	public Banji() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Banji that) {
		setId(that.getId());
		setSchoolId(that.getSchoolId());
		setName(that.getName());
		setMasterName(that.getMasterName());
		setMasterPhone(that.getMasterPhone());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("id=[").append(id).append("] ");
		buffer.append("schoolId=[").append(schoolId).append("] ");
		buffer.append("name=[").append(name).append("] ");
		buffer.append("masterName=[").append(masterName).append("] ");
		buffer.append("masterPhone=[").append(masterPhone).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((id == null) ? 0 : id.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Banji))
			return false;
		Banji equalCheck = (Banji) obj;
		if ((id == null && equalCheck.id != null) || (id != null && equalCheck.id == null))
			return false;
		if (id != null && !id.equals(equalCheck.id))
			return false;
		return true;
	}
}
